home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / gamma-bros.swf / scripts / __Packages / classes / misc / Intro.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  27.5 KB  |  880 lines

  1. class classes.misc.Intro
  2. {
  3.    var clip;
  4.    var clip2;
  5.    var trans;
  6.    var colorTrans;
  7.    var keyListener;
  8.    var reconArray;
  9.    var mainMenu;
  10.    var reconKey;
  11.    var reconIndex;
  12.    var neonVar;
  13.    var c = 0;
  14.    var wheelBot = false;
  15.    var flyBot = false;
  16.    var wheelDoorOpen = false;
  17.    var flyDoorOpen = false;
  18.    var gameStarted = false;
  19.    var f2 = "";
  20.    var mainRoutine = "controlRoom";
  21.    var bro1EnteringShip = false;
  22.    var bro2EnteringShip = false;
  23.    var currentBro = 2;
  24.    var c2 = 0;
  25.    var reconfig = false;
  26.    var Name = "intro";
  27.    function Intro()
  28.    {
  29.       this.clip = _root.attachMovie("introScreen","introScreen",90000);
  30.       this.clip.mainClip.cacheAsBitmap = true;
  31.       this.clip.bro1._visible = false;
  32.       this.clip.bro2._visible = false;
  33.       this.clip2 = _root.attachMovie("introOverlay","introOverlay",110000);
  34.       _root.introBro1 = new classes.bro.IntroBro1(735,468);
  35.       _root.addChar("introBro1");
  36.       _root.introBro2 = new classes.bro.IntroBro2(480,462);
  37.       _root.addChar("introBro2");
  38.       this.trans = new flash.geom.Transform(this.clip.title.neon);
  39.       this.colorTrans = new flash.geom.ColorTransform(1,1,1,1,0,0,0,0);
  40.       this.trans.colorTransform = this.colorTrans;
  41.       _root.starB = new classes.fx.StarB();
  42.       _root.addFX("starB");
  43.       this.keyListener = new Object();
  44.       this.keyListener.onKeyDown = function()
  45.       {
  46.          _root.audio.playLevel5("computerBlip" + (random(16) + 1),_root.randRange(22,28));
  47.          var _loc2_ = Key.getCode();
  48.          if(_root.intro.reconfig)
  49.          {
  50.             _root.intro.sendReconKey(_loc2_,Key.getAscii());
  51.          }
  52.          else if(_loc2_ == 39)
  53.          {
  54.             _root.intro.pressRight();
  55.          }
  56.          else if(_loc2_ == 37)
  57.          {
  58.             _root.intro.pressLeft();
  59.          }
  60.          else if(_loc2_ == 40)
  61.          {
  62.             _root.intro.pressDown();
  63.          }
  64.          else if(_loc2_ == 38)
  65.          {
  66.             _root.intro.pressUp();
  67.          }
  68.          else if(_loc2_ == 13)
  69.          {
  70.             _root.intro.pressEnter();
  71.          }
  72.       };
  73.       Key.addListener(this.keyListener);
  74.       this.reconArray = [38,40,37,39,87,83,65,68];
  75.       this.mainMenu = new Object();
  76.       this.mainMenu.array = new Array();
  77.       this.mainMenu.currentIndex = 0;
  78.       this.mainMenu.focus = "mainM";
  79.       this.mainMenu.startIt = new Object();
  80.       this.mainMenu.options = new Object();
  81.       this.mainMenu.info = new Object();
  82.       this.mainMenu.options.array = new Array();
  83.       this.mainMenu.options.dif = new Object();
  84.       this.mainMenu.options.pass = new Object();
  85.       this.mainMenu.options.exit = new Object();
  86.       this.mainMenu.startIt.highlight = "startH";
  87.       this.mainMenu.options.highlight = "optionsH";
  88.       this.mainMenu.info.highlight = "infoH";
  89.       this.mainMenu.startIt.exec = "startGame";
  90.       this.mainMenu.options.exec = "optionsX";
  91.       this.mainMenu.info.exec = "infoX";
  92.       this.mainMenu.options.dif.highlight = "optionsDifH";
  93.       this.mainMenu.options.pass.highlight = "optionsPassH";
  94.       this.mainMenu.options.exit.highlight = "optionsExitH";
  95.       this.mainMenu.options.dif.exec = "optionsDifX";
  96.       this.mainMenu.options.dif.current = _root.dif.num;
  97.       this.mainMenu.options.pass.exec = "optionsPassX";
  98.       this.mainMenu.options.exit.exec = "optionsExitX";
  99.       this.mainMenu.array.push(this.mainMenu.startIt);
  100.       this.mainMenu.array.push(this.mainMenu.info);
  101.       this.mainMenu.array.push(this.mainMenu.options);
  102.       this.mainMenu.options.array.push(this.mainMenu.options.dif);
  103.       this.mainMenu.options.array.push(this.mainMenu.options.pass);
  104.       this.mainMenu.options.array.push(this.mainMenu.options.exit);
  105.       this.startH();
  106.       this.clip.screen._visible = false;
  107.       this.clip.menu.btStart.enabled = true;
  108.       this.clip.menu.btInfo.enabled = true;
  109.       this.clip.menu.btOptions.enabled = true;
  110.       this.clip.menu.btStart.onRollOver = function()
  111.       {
  112.          _root.intro.startH();
  113.       };
  114.       this.clip.menu.btStart.onPress = function()
  115.       {
  116.          _root.intro.startGame();
  117.       };
  118.       this.clip.menu.btInfo.onRollOver = function()
  119.       {
  120.          _root.intro.infoH();
  121.       };
  122.       this.clip.menu.btInfo.onPress = function()
  123.       {
  124.          _root.intro.infoX();
  125.       };
  126.       this.clip.menu.btOptions.onRollOver = function()
  127.       {
  128.          _root.intro.optionsH();
  129.       };
  130.       this.clip.menu.btOptions.onPress = function()
  131.       {
  132.          _root.intro.optionsX();
  133.       };
  134.    }
  135.    function startH()
  136.    {
  137.       this.mainMenu.currentIndex = 0;
  138.       this.clip.menu.start.gotoAndStop("over");
  139.       this.clip.menu.options.gotoAndStop("off");
  140.       this.clip.menu.info.gotoAndStop("off");
  141.    }
  142.    function optionsH()
  143.    {
  144.       this.mainMenu.currentIndex = 2;
  145.       this.clip.menu.start.gotoAndStop("off");
  146.       this.clip.menu.options.gotoAndStop("over");
  147.       this.clip.menu.info.gotoAndStop("off");
  148.    }
  149.    function infoH()
  150.    {
  151.       this.mainMenu.currentIndex = 1;
  152.       this.clip.menu.start.gotoAndStop("off");
  153.       this.clip.menu.options.gotoAndStop("off");
  154.       this.clip.menu.info.gotoAndStop("over");
  155.    }
  156.    function optionsX()
  157.    {
  158.       this.clip.menu.options.gotoAndStop("on");
  159.       this.clip.title.gotoAndStop(2);
  160.       this.clip.screen.gotoAndStop("options");
  161.       this.clip.screen._visible = true;
  162.       this.clip.menu.btStart.enabled = false;
  163.       this.clip.menu.btInfo.enabled = false;
  164.       this.clip.menu.btOptions.enabled = false;
  165.       this.clip.screen.options.btDif.onRollOver = function()
  166.       {
  167.          _root.intro.optionsDifH();
  168.       };
  169.       this.clip.screen.options.btDif.onPress = function()
  170.       {
  171.          _root.intro.optionsDifX();
  172.       };
  173.       this.clip.screen.options.btPass.onRollOver = function()
  174.       {
  175.          _root.intro.optionsPassH();
  176.       };
  177.       this.clip.screen.options.btPass.onPress = function()
  178.       {
  179.          _root.intro.passPress();
  180.       };
  181.       this.clip.screen.options.btExit.onRollOver = function()
  182.       {
  183.          _root.intro.optionsExitH();
  184.       };
  185.       this.clip.screen.options.btExit.onPress = function()
  186.       {
  187.          _root.intro.optionsExitX();
  188.       };
  189.       this.mainMenu.focus = "options";
  190.       this.mainMenu.options.currentIndex = 0;
  191.       this[this.mainMenu.options.array[this.mainMenu.options.currentIndex].highlight]();
  192.    }
  193.    function passPress()
  194.    {
  195.       Selection.setFocus(this.clip.screen.options.pass.passBox);
  196.    }
  197.    function infoX()
  198.    {
  199.       this.clip.menu.btStart.enabled = false;
  200.       this.clip.menu.btInfo.enabled = false;
  201.       this.clip.menu.btOptions.enabled = false;
  202.       this.clip.menu.info.gotoAndStop("on");
  203.       this.clip.title.gotoAndStop(2);
  204.       this.clip.screen.gotoAndStop("info");
  205.       this.clip.screen._visible = true;
  206.       this.mainMenu.focus = "info";
  207.       this.clip.screen.info.gotoAndStop(this.mainMenu.info.currentFrame);
  208.    }
  209.    function optionsDifH()
  210.    {
  211.       this.mainMenu.options.currentIndex = 0;
  212.       this.mainMenu.options.passHi = false;
  213.       this.clip.screen.options.difficulty._alpha = 100;
  214.       this.clip.screen.options.pass._alpha = 15;
  215.       this.clip.screen.options.exit._alpha = 15;
  216.       this.clip.screen.options.difficulty.choices.gotoAndStop(this.mainMenu.options.dif.current);
  217.    }
  218.    function optionsPassH()
  219.    {
  220.       if(!this.mainMenu.options.passHi)
  221.       {
  222.          this.mainMenu.options.currentIndex = 1;
  223.          this.mainMenu.options.passHi = true;
  224.          this.clip.screen.options.difficulty._alpha = 15;
  225.          this.clip.screen.options.pass._alpha = 100;
  226.          this.clip.screen.options.exit._alpha = 15;
  227.          Selection.setFocus(this.clip.screen.options.pass.passBox);
  228.          this.clip.screen.options.pass.passBox.html = false;
  229.       }
  230.    }
  231.    function optionsExitH()
  232.    {
  233.       this.mainMenu.options.currentIndex = 2;
  234.       this.mainMenu.options.passHi = false;
  235.       this.clip.screen.options.difficulty._alpha = 15;
  236.       this.clip.screen.options.pass._alpha = 15;
  237.       this.clip.screen.options.exit._alpha = 100;
  238.    }
  239.    function optionsDifX()
  240.    {
  241.       var _loc3_ = this.clip.screen.options.difficulty.choices;
  242.       if(this.mainMenu.options.dif.current == 1)
  243.       {
  244.          _loc3_.gotoAndStop(2);
  245.          _root.changeDif("med");
  246.          this.mainMenu.options.dif.current = 2;
  247.       }
  248.       else if(this.mainMenu.options.dif.current == 2)
  249.       {
  250.          _loc3_.gotoAndStop(3);
  251.          _root.changeDif("hard");
  252.          this.mainMenu.options.dif.current = 3;
  253.       }
  254.       else if(this.mainMenu.options.dif.current == 3)
  255.       {
  256.          _loc3_.gotoAndStop(1);
  257.          _root.changeDif("easy");
  258.          this.mainMenu.options.dif.current = 1;
  259.       }
  260.    }
  261.    function optionsPassX()
  262.    {
  263.       var _loc3_ = this.clip.screen.options.pass.passBox.text;
  264.       if(_loc3_ == "super")
  265.       {
  266.          _root.bro1Weapon = "superLaser";
  267.          _root.bro2Weapon = "superLaser";
  268.          _root.audio.playLevel5("computer6",_root.randRange(31,37));
  269.          _root.audio.playLevel2("tagTeam1",20);
  270.       }
  271.       else if(_loc3_ == "golvl2")
  272.       {
  273.          _root.level = 2;
  274.          _root.warp = true;
  275.          _root.subLevelNum = 1;
  276.          _root.bgLevel2();
  277.          _root.coins.num = _root.coins.numT = _root.stats.coins = _root.stats.totalCoins = 175;
  278.          _root.gems.num = _root.gems.numT = _root.stats.gems = _root.stats.totalGems = 15;
  279.          _root.bro1Weapon = "tripleLaserA";
  280.          _root.bro2Weapon = "tripleLaserA";
  281.          _root.audio.playLevel5("computer6",_root.randRange(31,37));
  282.          _root.audio.playLevel2("tagTeam1",20);
  283.       }
  284.       else if(_loc3_ == "golvl3")
  285.       {
  286.          _root.level = 3;
  287.          _root.warp = true;
  288.          _root.bgLevel3();
  289.          _root.coins.num = _root.coins.numT = _root.stats.coins = _root.stats.totalCoins = 350;
  290.          _root.gems.num = _root.gems.numT = _root.stats.gems = _root.stats.totalGems = 20;
  291.          _root.subLevelNum = 1;
  292.          _root.bro1Weapon = "tripleTwistLaser";
  293.          _root.bro2Weapon = "tripleTwistLaser";
  294.          _root.audio.playLevel5("computer6",_root.randRange(31,37));
  295.          _root.audio.playLevel2("tagTeam1",20);
  296.       }
  297.       else if(_loc3_ == "ship2")
  298.       {
  299.          _root.shipPass = true;
  300.          _root.bro1ShipLevel = 2;
  301.          _root.bro2ShipLevel = 2;
  302.          _root.audio.playLevel5("computer6",_root.randRange(31,37));
  303.          _root.audio.playLevel2("tagTeam1",20);
  304.       }
  305.       else if(_loc3_ == "ship3")
  306.       {
  307.          _root.shipPass = true;
  308.          _root.bro1ShipLevel = 3;
  309.          _root.bro2ShipLevel = 3;
  310.          _root.audio.playLevel5("computer6",_root.randRange(31,37));
  311.          _root.audio.playLevel2("tagTeam1",20);
  312.       }
  313.    }
  314.    function optionsExitX()
  315.    {
  316.       this.mainMenu.options.passHi = false;
  317.       this.clip.menu.btStart.enabled = true;
  318.       this.clip.menu.btInfo.enabled = true;
  319.       this.clip.menu.btOptions.enabled = true;
  320.       this.mainMenu.focus = "mainM";
  321.       this[this.mainMenu.array[this.mainMenu.currentIndex].highlight]();
  322.       this.clip.title.gotoAndStop(1);
  323.       this.clip.screen._visible = false;
  324.    }
  325.    function infoExitX()
  326.    {
  327.       this.clip.menu.btStart.enabled = true;
  328.       this.clip.menu.btInfo.enabled = true;
  329.       this.clip.menu.btOptions.enabled = true;
  330.       this.mainMenu.focus = "mainM";
  331.       this[this.mainMenu.array[this.mainMenu.currentIndex].highlight]();
  332.       this.clip.title.gotoAndStop(1);
  333.       this.clip.screen._visible = false;
  334.    }
  335.    function shiftMainMenu(num)
  336.    {
  337.       this.mainMenu.currentIndex += num;
  338.       if(this.mainMenu.currentIndex < 0)
  339.       {
  340.          this.mainMenu.currentIndex = this.mainMenu.array.length - 1;
  341.       }
  342.       if(this.mainMenu.currentIndex == this.mainMenu.array.length)
  343.       {
  344.          this.mainMenu.currentIndex = 0;
  345.       }
  346.       this[this.mainMenu.array[this.mainMenu.currentIndex].highlight]();
  347.    }
  348.    function shiftOptions(num)
  349.    {
  350.       this.mainMenu.options.currentIndex += num;
  351.       if(this.mainMenu.options.currentIndex < 0)
  352.       {
  353.          this.mainMenu.options.currentIndex = this.mainMenu.options.array.length - 1;
  354.       }
  355.       if(this.mainMenu.options.currentIndex == this.mainMenu.options.array.length)
  356.       {
  357.          this.mainMenu.options.currentIndex = 0;
  358.       }
  359.       this[this.mainMenu.options.array[this.mainMenu.options.currentIndex].highlight]();
  360.    }
  361.    function mainM(what)
  362.    {
  363.       if(what == "up")
  364.       {
  365.          this.shiftMainMenu(1);
  366.       }
  367.       if(what == "down")
  368.       {
  369.          this.shiftMainMenu(-1);
  370.       }
  371.       if(what == "enter" || what == "right")
  372.       {
  373.          this[this.mainMenu.array[this.mainMenu.currentIndex].exec]();
  374.       }
  375.    }
  376.    function options(what)
  377.    {
  378.       if(what == "up")
  379.       {
  380.          this.shiftOptions(-1);
  381.       }
  382.       if(what == "down")
  383.       {
  384.          this.shiftOptions(1);
  385.       }
  386.       if(what == "enter" || what == "right")
  387.       {
  388.          this[this.mainMenu.options.array[this.mainMenu.options.currentIndex].exec]();
  389.       }
  390.       if(what == "left")
  391.       {
  392.          this.optionsExitX();
  393.       }
  394.    }
  395.    function info(what)
  396.    {
  397.       if(what == "right")
  398.       {
  399.          if(this.mainMenu.info.currentFrame != this.clip.screen.info._totalframes)
  400.          {
  401.             this.mainMenu.info.currentFrame = this.mainMenu.info.currentFrame + 1;
  402.             this.clip.screen.info.gotoAndStop(this.mainMenu.info.currentFrame);
  403.          }
  404.       }
  405.       if(what == "left")
  406.       {
  407.          if(this.mainMenu.info.currentFrame != 1)
  408.          {
  409.             this.mainMenu.info.currentFrame--;
  410.             this.clip.screen.info.gotoAndStop(this.mainMenu.info.currentFrame);
  411.          }
  412.          else
  413.          {
  414.             this.infoExitX();
  415.          }
  416.       }
  417.    }
  418.    function showConfig()
  419.    {
  420.       var _loc5_ = ["moveU","moveD","moveL","moveR","fireU","fireD","fireL","fireR"];
  421.       var _loc4_ = 0;
  422.       while(_loc4_ < 8)
  423.       {
  424.          var _loc3_ = _root[_loc5_[_loc4_]];
  425.          if(_loc3_ == 38 || _loc3_ == 37 || _loc3_ == 39 || _loc3_ == 40)
  426.          {
  427.             this.clip.screen.info["a" + _loc5_[_loc4_]].gotoAndStop("k" + _loc3_);
  428.             this.clip.screen.info[_loc5_[_loc4_]].text = "";
  429.          }
  430.          else
  431.          {
  432.             this.clip.screen.info["a" + _loc5_[_loc4_]].gotoAndStop(1);
  433.             this.clip.screen.info[_loc5_[_loc4_]].text = chr(_loc3_);
  434.          }
  435.          _loc4_ = _loc4_ + 1;
  436.       }
  437.    }
  438.    function recon(what)
  439.    {
  440.       if(!this.reconfig)
  441.       {
  442.          this.clip.screen.info.switchCredits._alpha = 15;
  443.          this.clip.screen.info.b1.enabled = false;
  444.          this.clip.screen.info.b2.enabled = false;
  445.          this.clip.screen.info.b3.enabled = false;
  446.          this.reconKey = what;
  447.          this.reconfig = true;
  448.          this.clip.screen.info["a" + this.reconKey].gotoAndStop(1);
  449.          this.clip.screen.info[this.reconKey].text = "?";
  450.          var _loc3_ = 0;
  451.          var _loc4_ = this.reconArray.length;
  452.          while(_loc3_ < _loc4_)
  453.          {
  454.             if(this.reconArray[_loc3_] == _root[this.reconKey])
  455.             {
  456.                this.reconArray.splice(_loc3_,1);
  457.                this.reconIndex = _loc3_;
  458.                break;
  459.             }
  460.             _loc3_ = _loc3_ + 1;
  461.          }
  462.       }
  463.    }
  464.    function sendReconKey(code, ascii)
  465.    {
  466.       if(code >= 37 && code <= 40 || code >= 48 && code <= 57 || code >= 65 && code <= 90)
  467.       {
  468.          this.reconfig = false;
  469.          var _loc5_ = 0;
  470.          var _loc7_ = this.reconArray.length;
  471.          while(_loc5_ < _loc7_)
  472.          {
  473.             if(this.reconArray[_loc5_] == code)
  474.             {
  475.                var _loc6_ = _loc5_ >= this.reconIndex ? _loc5_ + 1 : _loc5_;
  476.                this.reconfig = true;
  477.                this.reconArray.splice(this.reconIndex,0,code);
  478.                var _loc4_ = ["moveU","moveD","moveL","moveR","fireU","fireD","fireL","fireR"];
  479.                if(code == 38 || code == 37 || code == 39 || code == 40)
  480.                {
  481.                   this.clip.screen.info["a" + _loc4_[this.reconIndex]].gotoAndStop("k" + code);
  482.                   this.clip.screen.info[_loc4_[this.reconIndex]].text = "";
  483.                }
  484.                else
  485.                {
  486.                   this.clip.screen.info["a" + _loc4_[this.reconIndex]].gotoAndStop(1);
  487.                   this.clip.screen.info[_loc4_[this.reconIndex]].text = chr(code);
  488.                }
  489.                _root[this.reconKey] = code;
  490.                this.reconIndex = _loc6_;
  491.                this.reconArray.splice(this.reconIndex,1);
  492.                this.reconKey = _loc4_[this.reconIndex];
  493.                this.clip.screen.info["a" + this.reconKey].gotoAndStop(1);
  494.                this.clip.screen.info[this.reconKey].text = "?";
  495.                break;
  496.             }
  497.             _loc5_ = _loc5_ + 1;
  498.          }
  499.          if(!this.reconfig)
  500.          {
  501.             if(code == 38 || code == 37 || code == 39 || code == 40)
  502.             {
  503.                this.clip.screen.info["a" + this.reconKey].gotoAndStop("k" + code);
  504.                this.clip.screen.info[this.reconKey].text = "";
  505.             }
  506.             else
  507.             {
  508.                this.clip.screen.info["a" + this.reconKey].gotoAndStop(1);
  509.                this.clip.screen.info[this.reconKey].text = chr(code);
  510.             }
  511.             _root[this.reconKey] = code;
  512.             this.reconArray.splice(this.reconIndex,0,code);
  513.             this.clip.screen.info.switchCredits._alpha = 100;
  514.             this.clip.screen.info.b1.enabled = true;
  515.             this.clip.screen.info.b2.enabled = true;
  516.             this.clip.screen.info.b3.enabled = true;
  517.          }
  518.       }
  519.    }
  520.    function switchRecon()
  521.    {
  522.       if(!this.reconfig)
  523.       {
  524.          var _loc3_ = _root.fireU;
  525.          var _loc4_ = _root.fireD;
  526.          var _loc6_ = _root.fireL;
  527.          var _loc5_ = _root.fireR;
  528.          _root.fireU = _root.moveU;
  529.          _root.fireD = _root.moveD;
  530.          _root.fireL = _root.moveL;
  531.          _root.fireR = _root.moveR;
  532.          _root.moveU = _loc3_;
  533.          _root.moveD = _loc4_;
  534.          _root.moveL = _loc6_;
  535.          _root.moveR = _loc5_;
  536.          this.showConfig();
  537.          var _loc7_ = this.reconArray.splice(0,4);
  538.          this.reconArray = this.reconArray.concat(_loc7_);
  539.       }
  540.    }
  541.    function pressRight()
  542.    {
  543.       this[this.mainMenu.focus]("right");
  544.    }
  545.    function pressLeft()
  546.    {
  547.       this[this.mainMenu.focus]("left");
  548.    }
  549.    function pressDown()
  550.    {
  551.       this[this.mainMenu.focus]("down");
  552.    }
  553.    function pressUp()
  554.    {
  555.       this[this.mainMenu.focus]("up");
  556.    }
  557.    function pressEnter()
  558.    {
  559.       this[this.mainMenu.focus]("enter");
  560.    }
  561.    function showHangar()
  562.    {
  563.       _root.aC1.s1.setVolume(75);
  564.       this.clip.removeMovieClip();
  565.       this.clip2.removeMovieClip();
  566.       _root.introBro1.x = 1200;
  567.       _root.introBro2.x = 1050;
  568.       _root.introBroMaskClip.removeMovieClip();
  569.       _root.introBro1.xMov = -5;
  570.       _root.introBro2.xMov = -5;
  571.       _root.introBro1Clip._alpha = 100;
  572.       _root.introBro2Clip._alpha = 100;
  573.       _root.introBro1Clip.setMask(null);
  574.       _root.introBro1.f2 = "";
  575.       _root.introBro2.f2 = "";
  576.       if(this.wheelBot)
  577.       {
  578.          _root.removeChar("wheelBot");
  579.          this.wheelBot = false;
  580.       }
  581.       if(this.flyBot)
  582.       {
  583.          _root.removeChar("flyBot");
  584.          this.flyBot = false;
  585.       }
  586.       _root.introBro1.x = 1250;
  587.       _root.introBro2.x = 1050;
  588.       this.clip = _root.attachMovie("hangar","hangar",90000);
  589.       this.clip.mainClip.bitmap.cacheAsBitmap = true;
  590.       this.mainRoutine = "hangar";
  591.       this.f2 = "waitForShips";
  592.    }
  593.    function startGame()
  594.    {
  595.       _root.initWaveScripts();
  596.       this.clip.menu.btStart.enabled = false;
  597.       this.clip.menu.btInfo.enabled = false;
  598.       this.clip.menu.btOptions.enabled = false;
  599.       this.clip.menu.start.gotoAndStop("on");
  600.       Key.removeListener(this.keyListener);
  601.       this.gameStarted = true;
  602.       _root.introBro1.startGame();
  603.       _root.introBro2.startGame();
  604.       this.f2 = "starting1";
  605.    }
  606.    function startGame2()
  607.    {
  608.       _root.initWaveScripts();
  609.       this.clip.removeMovieClip();
  610.       this.clip2.removeMovieClip();
  611.       _root.removeChar("introBro1");
  612.       _root.removeChar("introBro2");
  613.       _root.introBroMaskClip.removeMovieClip();
  614.       if(this.wheelBot)
  615.       {
  616.          _root.removeChar("wheelBot");
  617.          this.wheelBot = false;
  618.       }
  619.       if(this.flyBot)
  620.       {
  621.          _root.removeChar("flyBot");
  622.          this.flyBot = false;
  623.       }
  624.       if(_root.char == "broShip1")
  625.       {
  626.          _root.broShip1 = new classes.bro.BroShip1(794,196);
  627.          _root.addChar("broShip1");
  628.       }
  629.       else if(_root.char == "broShip2")
  630.       {
  631.          _root.broShip2 = new classes.bro.BroShip2(408,196);
  632.          _root.addChar("broShip2");
  633.       }
  634.       else if(_root.char == "bro1")
  635.       {
  636.          _root.bro1 = new classes.bro.Bro1(408,196);
  637.          _root.addChar("bro1");
  638.       }
  639.       else if(_root.char == "bro2")
  640.       {
  641.          _root.bro2 = new classes.bro.Bro2(408,196);
  642.          _root.addChar("bro2");
  643.       }
  644.       if(_root.char2 == "broShip1")
  645.       {
  646.          _root.broShip1 = new classes.bro.BroShip1(794,196);
  647.          _root.addChar("broShip1");
  648.       }
  649.       else if(_root.char2 == "broShip2")
  650.       {
  651.          _root.broShip2 = new classes.bro.BroShip2(408,196);
  652.          _root.addChar("broShip2");
  653.       }
  654.       else if(_root.char2 == "bro1")
  655.       {
  656.          _root.bro1 = new classes.bro.Bro1(408,196);
  657.          _root.addChar("bro1");
  658.       }
  659.       else if(_root.char2 == "bro2")
  660.       {
  661.          _root.bro2 = new classes.bro.Bro2(408,196);
  662.          _root.addChar("bro2");
  663.       }
  664.       if(_root.char == "broShip1")
  665.       {
  666.          _root.broShip2.action1();
  667.       }
  668.       else
  669.       {
  670.          _root.broShip1.action1();
  671.       }
  672.       _root.game = 1;
  673.       _root.levelInit();
  674.       _root.removeFX("intro");
  675.       _root.starB.stopStars();
  676.       _root.star = new classes.fx.Star();
  677.       _root.addFX("star");
  678.       _root.star.phase2();
  679.    }
  680.    function starting1()
  681.    {
  682.       if(_root.introBro2.x <= 264)
  683.       {
  684.          _root.introBro2.punchOut();
  685.          this.f2 = "starting2";
  686.       }
  687.    }
  688.    function starting2()
  689.    {
  690.       if(_root.introBro1.x <= 310)
  691.       {
  692.          if(!_root.bro1Punch)
  693.          {
  694.             _root.introBro1.wait();
  695.          }
  696.          this.f2 = "starting3";
  697.       }
  698.    }
  699.    function starting3()
  700.    {
  701.       if(_root.introBro1.x <= 264)
  702.       {
  703.          _root.introBro1.punchOut();
  704.          delete _root.bro1Punch;
  705.          this.f2 = "starting4";
  706.       }
  707.    }
  708.    function starting4()
  709.    {
  710.       if(_root.introBro1.x < 50)
  711.       {
  712.          this.showHangar();
  713.       }
  714.    }
  715.    function controlRoom()
  716.    {
  717.       if(random(1000) > 997 && !this.wheelBot && !this.wheelDoorOpen)
  718.       {
  719.          this.wheelBot = true;
  720.          _root.wheelBot = new classes.misc.WheelBot(0,492);
  721.          _root.addChar("wheelBot");
  722.       }
  723.       if(random(1000) > 997 && !this.flyBot)
  724.       {
  725.          this.flyBot = true;
  726.          _root.flyBot = new classes.misc.FlyBot(24,399);
  727.          _root.addChar("flyBot");
  728.       }
  729.       if(Key.isDown(32) && !this.gameStarted)
  730.       {
  731.          this.startGame();
  732.       }
  733.       if(Key.isDown(16) && this.gameStarted)
  734.       {
  735.          this.startGame2();
  736.       }
  737.       this.neonVar += _root.randRange(-35,35);
  738.       if(random(10) > 2)
  739.       {
  740.          this.neonVar = 0;
  741.       }
  742.       this.colorTrans.redOffset = this.neonVar;
  743.       this.colorTrans.greenOffset = this.neonVar;
  744.       this.colorTrans.blueOffset = this.neonVar;
  745.       this.trans.colorTransform = this.colorTrans;
  746.       if(random(100) > 95)
  747.       {
  748.          _root.audio.playLevel5("computerBlip" + (random(16) + 1),_root.randRange(2,8));
  749.       }
  750.       if(random(200) == 199)
  751.       {
  752.          _root.audio.playLevel5("computer" + (random(7) + 2),_root.randRange(2,7));
  753.       }
  754.    }
  755.    function hangar()
  756.    {
  757.    }
  758.    function waitForShips()
  759.    {
  760.       if(_root.introBro1.x <= 612 && !this.bro1EnteringShip)
  761.       {
  762.          this.bro1EnteringShip = true;
  763.          _root.removeChar("introBro1");
  764.          _root.hangar.broShip1.gotoAndPlay("getInShip");
  765.       }
  766.       if(_root.introBro2.x <= 465 && !this.bro2EnteringShip)
  767.       {
  768.          this.bro2EnteringShip = true;
  769.          _root.removeChar("introBro2");
  770.          _root.hangar.broShip2.gotoAndPlay("getInShip");
  771.       }
  772.    }
  773.    function bro1EnteredShip()
  774.    {
  775.       _root.hangar.broShip1.gotoAndStop("main");
  776.       _root.hangar.broShip1.clip.gotoAndStop(2);
  777.       _root.hangar.broShip1B.gotoAndStop("main");
  778.       _root.hangar.broShip1B.clip.gotoAndStop(2);
  779.       this.chooseBro();
  780.    }
  781.    function bro2EnteredShip()
  782.    {
  783.       _root.hangar.broShip2.gotoAndStop("main");
  784.       _root.hangar.broShip2.clip.gotoAndStop(2);
  785.       _root.hangar.broShip2B.gotoAndStop("main");
  786.       _root.hangar.broShip2B.clip.gotoAndStop(2);
  787.    }
  788.    function chooseBro()
  789.    {
  790.       this.f2 = "broChoosing";
  791.       _root.attachMovie("selectArrow","selectArrowClip",90510);
  792.       _root.selectArrowClip._x = 414;
  793.       _root.selectArrowClip._y = 372;
  794.       _root.hangar.broShip2.clip.body.gotoAndStop("faceF");
  795.    }
  796.    function broChoosing()
  797.    {
  798.       if(Key.isDown(37))
  799.       {
  800.          if(this.currentBro == 1)
  801.          {
  802.             _root.selectArrowClip._x = 414;
  803.             this.currentBro = 2;
  804.             _root.audio.playLevel5("buzzSelect",5);
  805.             _root.hangar.broShip2.clip.body.gotoAndStop("faceF");
  806.             _root.hangar.broShip1.clip.body.gotoAndStop("FU");
  807.          }
  808.       }
  809.       if(Key.isDown(39))
  810.       {
  811.          if(this.currentBro == 2)
  812.          {
  813.             _root.selectArrowClip._x = 561;
  814.             this.currentBro = 1;
  815.             _root.audio.playLevel5("zapSelect",5);
  816.             _root.hangar.broShip1.clip.body.gotoAndStop("faceF");
  817.             _root.hangar.broShip2.clip.body.gotoAndStop("FU");
  818.          }
  819.       }
  820.       if(Key.isDown(13))
  821.       {
  822.          _root.selectArrowClip.removeMovieClip();
  823.          _root.char = this.currentBro != 1 ? "broShip2" : "broShip1";
  824.          _root.char2 = this.currentBro != 1 ? "broShip1" : "broShip2";
  825.          _root.hangar.broShip1.clip.body.gotoAndStop("FU");
  826.          _root.hangar.broShip2.clip.body.gotoAndStop("FU");
  827.          this.descend();
  828.       }
  829.    }
  830.    function descend()
  831.    {
  832.       _root.audio.playLevel2("floorDrop",25);
  833.       _root.audio.playLevel1("exitTheme",12,1,0.05);
  834.       _root.hangar.gotoAndPlay("go");
  835.       this.f2 = "descending";
  836.       this.mainRoutine = "";
  837.       _root.star = new classes.fx.Star();
  838.       _root.addFX("star");
  839.    }
  840.    function descending()
  841.    {
  842.       this.c2 = this.c2 + 1;
  843.       if(this.c2 == 60)
  844.       {
  845.          _root.starB.stopStars();
  846.          _root.star.makeStars();
  847.       }
  848.    }
  849.    function controlShip()
  850.    {
  851.       _root.hangar.broShip1._visible = false;
  852.       _root.hangar.broShip2._visible = false;
  853.       _root.broShip1 = new classes.bro.BroShip1(794,202);
  854.       _root.addChar("broShip1");
  855.       _root.broShip2 = new classes.bro.BroShip2(408,202);
  856.       _root.addChar("broShip2");
  857.       if(_root.warp)
  858.       {
  859.          _root[_root.char2].warpLeave();
  860.       }
  861.       else
  862.       {
  863.          _root[_root.char2].action1();
  864.       }
  865.       _root.game = 1;
  866.    }
  867.    function startAction()
  868.    {
  869.       this.clip.removeMovieClip();
  870.       _root.levelInit();
  871.       _root.star.phase2();
  872.       _root.removeFX("intro");
  873.    }
  874.    function main()
  875.    {
  876.       this[this.f2]();
  877.       this[this.mainRoutine]();
  878.    }
  879. }
  880.